using System;
using System.Collections.Generic;
using System.Text;

namespace HermesPortal.Core
{
    public  class ChapterServices
    {
        private  ChapterServices(){}
        #region Chapters
        public static Chapter GetChapter(int sagaID, int chapterID, int creatorID)
        {
            return ChapterDAO.GetChapter(sagaID, chapterID, creatorID); 
        }

        public static Chapter GetChapterAdmin(int sagaID, int chapterID)
        {

            return ChapterDAO.GetChapterAdmin(sagaID, chapterID);  

        }

        public static List<Chapter> GetChapters(int sagaID, int creatorID)
        {

            return ChapterDAO.GetChapters(sagaID, creatorID);
        }

        public static List<Chapter> GetChaptersAdmin(int sagaID)
        {


            return ChapterDAO.GetChaptersAdmin(sagaID);
        }

        public static void UpdateChapter(Chapter chapter)
        {
            ChapterDAO.UpdateChapter(chapter);  
        }

        public static int InsertChapter(Chapter chapter)
        {
            return ChapterDAO.InsertChapter(chapter);
        }

        /// <summary>
        ///  Updates the DB with an existing chapters new ordinal value. 
        /// </summary>
        /// <param name="chapterID">The chapter that changed</param>
        /// <param name="sagaID">the saga the chapter belings to.</param>
        /// <param name="ordinal">the updated ordinal value</param>
        public static void ChapterOrderUpdate(int chapterID, int sagaID, int ordinal)
        {
            ChapterDAO.ChapterOrderUpdate(chapterID, sagaID, ordinal);
        }

        public static void DeleteChapeter(int chapterID)
        {
            ChapterDAO.DeleteChapter(chapterID); 
        }

        #endregion

        #region Sections

        public static List<Section> GetSections(int chapterId, int clientId)
        {
            return ChapterDAO.GetSections(chapterId, clientId);
        }

        public static List<Section> GetSectionsAdmin(int chapterId)
        {
            return ChapterDAO.GetSectionsAdmin(chapterId);
        }

        public static int InsertSection(Section section)
        {
            return ChapterDAO.InsertSection(section);
        }
        public static void UpdateSection(Section section)
        {
            ChapterDAO.UpdateSection(section);
        }

        public static void DeleteSection(int sectionId)
        {
            ChapterDAO.DeleteSection(sectionId);
        }
        #endregion

        #region Comments
        public static List<ChapterComment> GetComments(ChapterComment comment, int clientId)
        {
            return ChapterDAO.GetComments(comment, clientId);
        }

        public static List<ChapterComment> GetCommentsAdmin(ChapterComment comment)
        {
            return ChapterDAO.GetCommentsAdmin(comment);
        }

        public static int InsertComment(ChapterComment comment)
        {
            return ChapterDAO.InsertComment(comment);
        }
        public static void UpdateComment(ChapterComment comment)
        {
            ChapterDAO.UpdateComment(comment);
        }

        public static void DeleteComment(int sectionId)
        {
            ChapterDAO.DeleteComment(sectionId);
        }


        #endregion
    }
}
